<template>
	<view>
		<view class="teacher">
			<view>
				<view class="box-bg">
					<uni-nav-bar height="15vh" title="好老师" />
				</view>
			</view>
			<view class="teacher-item" v-for="item in teacherList">
				<view class="teacher-item-name">
					{{item.name}}
				</view>
				<view class="teacher-item-image">
					<image :src="item.image"></image>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
import { getTeacherList } from '../../api/user'
import{baseUrl} from '../../config.js'
	export default {
		data() {
			return {
				teacherList:[]
			}
		},
		methods: {
			
		},
		onLoad() {
			getTeacherList().then(res=>{
				console.log(res);
				for (var i = 0; i < res.data.data.length; i++) {
					res.data.data[i].image=baseUrl+'/common/download?name='+res.data.data[i].image
					if(res.data.data[i].sex==1){
						res.data.data[i].sex="男"
					}else{
						res.data.data[i].sex="女"
					}
				}
				this.teacherList=res.data.data
			})
		}
	}
</script>

<style>
.teacher-item{
	background-color: white;
	position: relative;
	height: 14vh;
}
.teacher-item-image{
	width:10vh;
	height: 10vh;
	position: absolute;
	top: 2vh;
	left: 2vh;
	
}
.teacher-item-image image{
	width: 100%;
	height: 100%;
	border-radius: 50%;
}
.teacher-item-name{
	font-size: 3vh;
	font-weight: bold;
	position: absolute;
	top: 5vh;
	left: 15vh;
}
</style>
